package com.ethink.warehouse.api;

import com.ethink.warehouse.api.request.SubWarehouseStatusSetRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RequestParam;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.warehouse.api.info.SubWarehouseInfo;
import com.ethink.warehouse.api.request.SubWarehouseAddRequest;
import com.ethink.warehouse.api.request.SubWarehouseQueryRequest;
import com.ethink.warehouse.api.request.SubWarehouseUpdateRequest;
import com.ethink.warehouse.api.response.SubWarehouseAddResponse;

import java.util.List;

/**
 * 仓库分仓 Facade接口
 *
 * @author default
 * @date 2022-11-01
 */
@FeignClient(name = "ethink-warehouse-service", path = "warehouse-service/facade/v1/subWarehouse", contextId = "subWarehouseFacade")
public interface SubWarehouseFacade {

    @PostMapping("/querySubWarehouse")
    @ResponseBody
    Page<SubWarehouseInfo> querySubWarehouse(@RequestBody SubWarehouseQueryRequest request);

    @PostMapping("/getSubWarehouseById")
    @ResponseBody
    SubWarehouseInfo getSubWarehouseById(@RequestParam("subWarehouseId") Long subWarehouseId);

    @PostMapping("/getSubWarehouseByCode")
    @ResponseBody
    SubWarehouseInfo getSubWarehouseByCode(@RequestParam("subWarehouseCode") String subWarehouseCode);


    @PostMapping("/listSubWarehouse")
    @ResponseBody
    List<SubWarehouseInfo> listSubWarehouse();

    @PostMapping("/addSubWarehouse")
    @ResponseBody
    SubWarehouseAddResponse addSubWarehouse(@RequestBody SubWarehouseAddRequest request);

    @PostMapping("/updateSubWarehouse")
    @ResponseBody
    void updateSubWarehouse(@RequestBody SubWarehouseUpdateRequest request);

    @PostMapping("/setSubWarehouseStatus")
    @ResponseBody
    void setSubWarehouseStatus(@RequestBody SubWarehouseStatusSetRequest request);

}